import axios from 'axios'
import { reportData } from "../types/data";
const api = "/api/alphabetscoreoss";

export default async (imgSrc:string):Promise<reportData|string> =>{
  const data = {
    "payload": {
      "worddata": []
    },
    "filesurl": [imgSrc]
  }
  try{
    const res = await axios({
      url:api,
      method:'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data,
    });
    return res.data
  }catch(err){
    console.log(err);
    
    return "请求出错"
  }
}